<?php
/**
 * 系统API接口类
 * @author           袁志蒙  
 * @license          http://www.yzmcms.com
 * @lastmodify       2017-01-18
 */

defined('IN_YZMPHP') or exit('Access Denied');
yzm_base::load_common('class/jst.class.php');
new_session_start();

class jst{
	
	/*获取access_token*/
	public function get_token(){
		$code = $_GET['code'];
		$state = $_GET['state'];
		//更新token信息
		$jst = new jst($company);
		$result = $jst->token($code);
		if($result['code'] == 0 && $result['data']['access_token']){
			$result = $result['data'];
			$data = ['access_token'=>$result['access_token'],'expires_in'=>$result['expires_in']+time(),'refresh_token'=>$result['refresh_token']];
			D('jst_list')->update($data, array('id' => $state));
			delcache('jst_list');
		}
	}

}